package modular.hdfs;

public class WordCountMapper implements Mapper {

    public void map(String line, ContextMe contextMe) {
        String[] strings = line.split("\\$");

        for (String s : strings) {
            Object object = contextMe.getObject(s);
            if (null == object) {
                contextMe.write(s, 1);
            } else {
                int v = (Integer) object;
                contextMe.write(s, v + 1);
            }
        }


    }


}
